function ColorPicker(obj){//alert("ColorPicker.layoutBuiltFlag-->"+ColorPicker.layoutBuiltFlag);
	this.obj = obj;
	this.buildLayout();
}
ColorPicker.prototype.buildLayout = function() {
	var layout=null;
	if(ColorPicker.layoutBuiltFlag){//alert('get');
		layout = $("colorLayDiv");
	}
	else{//alert('set');
		layout = document.createElement("div");
		layout.id='colorLayDiv';
		layout.style.cssText = "position:absolute;width:100px;height:100px;background-color:pink;";		
		layout.innerHTML = "<input style='margin:10px;width:70px;'/><br/><input type='button' value='apply color'/>";
		document.body.appendChild(layout);
		ColorPicker.layoutBuiltFlag=true;
	}
	var offset = this.obj.cumulativeOffset();
	layout.style.left=offset[0]+20+'px';
	layout.style.top=offset[1]+'px';
	if(this.obj.value!=''){
		layout.style.backgroundColor=obj.value;
	}
	else{
		layout.style.backgroundColor='black';
	}
	//alert(layout.outerHTML);
}
ColorPicker.layoutBuiltFlag=false;
//alert('ColorPicker.layoutBuiltFlag::'+ColorPicker.layoutBuiltFlag);